SQL
Server 2008 has both a server and a client-side component for tracing
activity on a server. The SQL trace facility is the server-side
component that manages queues of events initiated by event producers on
the server. Extended stored procedures can be used to define the
server-side events that are to be captured.
The SQL Profiler is the
client-side tracing facility. It comes with a fully functional GUI that
allows for real-time auditing of SQL Server events. When it is used to
trace server activity, events that are part of a trace definition are
gathered at the server. Any filters defined as part of the trace
definition are applied, and the event data is queued for its final
destination. The SQL Profiler application is the final destination when
client-side tracing is used. The basic elements involved in this process
are shown in Figure 1.
This figure illustrates the following four steps in the process when tracing from the SQL Server Profiler:
1. | Event producers, such as the Query Processor, Lock Manager, ODS, and so on, raise events for the SQL Server Profiler.
|
2. | The
filters define the information to submit to SQL Server Profiler. A
producer will not send events if the event is not included in the
filter.
|
3. | SQL Server Profiler queues all the events.
|
4. | SQL
Server Profiler writes the events to each defined consumer, such as a
flat file, a table, the Profiler client window, and so on.
|
In addition to obtaining its
trace data from the event producers listed in step 1, you can also
configure SQL Profiler so that it obtains its data from a previously
saved location. This includes trace data saved in a file or table.